/*
 * Copyright (c) 2010, Thiago Campos Viana.
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in
 *       the documentation and/or other materials provided with the
 *       distribution.
 *     * Neither the name of Thiago Campos Viana nor the names of its
 *       contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package kernel.gamecode;

import java.nio.ByteBuffer;

/**
 *
 * @author Thiago Campos Viana
 */
public class Monster extends Character {

    /**
     *
     */
    public static final int monsterBufferSize = 10;


    /**
     *
     * @param id
     */
    public Monster(int id) {
        this.id = id;
        level = 1;
        hp = 40;
        maxHP = 40;

        sword = 0;
        mp = 0;
        maxMP = 0;


        switch (id) {
            case 0:
                name = "Kobold";
                attack = 12;
                agility = 0;
                gold = 2;
                experience = 1;
                break;
            case 1:
                name = "Gnoll";
                attack = 18;
                agility = 0;
                gold = 5;
                experience = 2;
                break;
            case 2:
                name = "Goblin";
                attack = 38;
                agility = 3;
                gold = 5;
                experience = 3;
                break;
            case 3:
                name = "Troll";
                attack = 32;
                agility = 7;
                gold = 5;
                experience = 5;
                break;
            case 4:
                name = "Orc";
                attack = 20;
                agility = 3;
                gold = 5;
                experience = 6;
                break;
            case 5:
                name = "Minotaur";
                attack = 34;
                agility = 7;
                gold = 5;
                experience = 7;
                break;
            case 6:
                name = "Golem";
                attack = 44;
                agility = 15;
                gold = 5;
                experience = 23;
                break;
            case 7:
                name = "Gnome";
                attack = 42;
                agility = 14;
                gold = 5;
                experience = 20;
                break;
            case 8:
                name = "Mummy";
                attack = 40;
                agility = 23;
                gold = 5;
                experience = 73;
                break;
            case 9:
                name = "Dwarf";
                attack = 48;
                agility = 35;
                gold = 20;
                experience = 89;
                break;
            case 10:
                name = "Beholder";
                attack = 48;
                agility = 31;
                gold = 10;
                experience = 92;
                break;
            case 11:
                name = "Dryad";
                attack = 54;
                agility = 57;
                gold = 10;
                experience = 190;
                break;
            case 12:
                name = "Genie";
                attack = 50;
                agility = 53;
                gold = 10;
                experience = 213;
                break;
            case 13:
                name = "Vampire";
                attack = 56;
                agility = 61;
                gold = 30;
                experience = 233;
                break;
            case 14:
                name = "Wizard";
                attack = 64;
                agility = 73;
                gold = 30;
                experience = 296;
                break;
            case 15:
                name = "Dragon";
                attack = 58;
                agility = 78;
                gold = 30;
                experience = 296;
                break;
            case 16:
                name = "Titan";
                hp = 184;
                attack = 42;
                agility = 11;
                gold = 45;
                experience = 87;
                break;
            case 17:
                name = "Zephyr";
                hp = 184;
                attack = 52;
                agility = 47;
                gold = 45;
                experience = 483;
                break;
            case 18:
                name = "Xorn";
                hp = 184;
                attack = 70;
                agility = 81;
                gold = 45;
                experience = 1850;
                break;
            case 19:
                name = "Undine";
                hp = 184;
                attack = 90;
                agility = 131;
                gold = 45;
                experience = 1798;
                break;
            case 20:
                name = "Efreet";
                hp = 184;
                attack = 96;
                agility = 137;
                gold = 45;
                experience = 2797;
                break;
        }

        armor = agility / 2;
        agility = agility / 2 + agility % 2;




    }

    /**
     *
     * @return
     */
    @Override
    public byte[] update() {
        return getBytes();
    }

    /**
     *
     * @return
     */
    @Override
    public byte[] getBytes() {
        bytes=ByteBuffer.allocate(Monster.monsterBufferSize);

        return bytes.array();
    }


}
